var fs=require('fs')
var path=require('path')
var stream=require('stream')
var Readable=stream.Readable;
var rs= new Readable();

var fromPath=path.join(__dirname,'/from.txt');
var toPath=path.join(__dirname,'/to.txt')

var readable=fs.createReadStream(fromPath);//创建可读流
var writable=fs.createWriteStream(toPath);//创建可写流
rs._read=function(){

}

readable.on('data',function(chunk){
    rs.push(chunk.toString('utf-8').toUpperCase())
})

rs.pipe(writable)